<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>色块练习</title>
    <style>
        *{
            margin:0;
            padding:0;
        }
        .banner{
            width: 3.23rem;
            height: 1.45rem;
            background: #76D1A7;
            margin: 0.735rem auto;
        }
    </style>
</head>
<body>
    <div class="banner"></div>

    <script>
        function adapter(){
            //改变 HTML 标签 fontSize 的值
            let size = document.documentElement.clientWidth * 100 / 375;
            //设置
            document.documentElement.style.fontSize = size + 'px';
        }
        //初始化调用
        adapter();

        //绑定事件
        window.onresize = adapter;
    </script>
</body>
</html>